<%@ page language="java" contentType="text/html;" pageEncoding="UTF-8"%>
<%@ include file="/views/global/taglibs.jsp"%>
<!DOCTYPE html>
<html>
<head>
<base href="<%=basePath%>">
<%@include file="/views/global/ShopInclude.jsp"%>
<link href="static/css/page/ProductEdit.css" rel="stylesheet" type="text/css">
<link href="static/css/page/submitStore.css" rel="stylesheet" type="text/css">
<title>STORE INFORMATION</title>
</head>
<body class="submitBg">
	<!-- 顶部导航条  -->
	<%@include file="/views/global/header.jsp"%>
	<c:set var="pageName" value="storeEdit"></c:set>
	<%@include file="/views/global/SellerHeader.jsp"%>
	<!-- 顶部导航条结束  -->
	<div class="submit-form submitFormContainer center font fontColorGray">
		<!-- 表单填写部分 -->
		<div class="submitFormTitle">
			<p style="float: right;">REVISE</p>
		</div>
		<hr class="hrBorder">
		    <c:choose>
		       <c:when test="${editType eq 'designerApply' }">
		       <table>
                <tr class="sellerNameLine">
					<td class="formLabel left"><input type="radio"
						name="sellerType" class="checkbox" value="PERSONAL"
						onclick="javascript:document.getElementById('company_table').style.display ='none';document.getElementById('personal_table').style.display ='';"
						<c:if test="${empty designer or 'PERSONAL' eq designer.sellerType }"> checked="checked"</c:if> />&nbsp;PERSONAL&nbsp;&nbsp;SELLER
						<span style="width: 30px;"></span></td>
					<td><input type="radio"  name="sellerType" class="checkbox"
						value="INDEPENDENT_BRAND"
						onclick="javascript:document.getElementById('personal_table').style.display ='none';document.getElementById('company_table').style.display ='';"
						<c:if test="${'INDEPENDENT_BRAND' eq designer.sellerType }"> checked="checked"</c:if> />&nbsp;COMPANY
					
				</tr>
               </table>
		       </c:when>
		       <c:otherwise>
		       <input type="hidden" name="sellerType" value="${designer.sellerType }"/>
		       </c:otherwise>
		    </c:choose>
		    
             
			<table style="margin-top: 50px;">
				<tr class="storePortraitLine" style="height: 225px;">
					<td class="formLabel left" style="margin-top: 10px;">PROFILE PIC:</td>
					<td class="row">
					<form id="addPortrailtImageFileForm" action="" method="post" enctype="multipart/form-data">
						<div class="addStoreImageArea col-xs-3">
						<input id="addPortrailtImageFile" name="addPortrailtImage"
								class="addStoreImage" type="file" accept="img/*" />
								 <img class="addImageIcon" src="static/images/page/submitCommodity/photoAddIcon.png" />
						</div>
						<ul id="portrailtImageAdded" class="storeImageAdded col-xs-9" style="height: 290px;">
						    <c:choose>
						      <c:when test="${not empty designer.sellerFileId }">
						      		<li class="addedStoreImage" style="height: 290px;"><img style="width:230px;height:290px;" src="${fileServerBasePath }download/${designer.sellerFileId  }" />
									<div class="storeImgDeleteIcon" onclick="deleteImage('portrailtImageAdded')"></div></li>
						      </c:when>
						      <c:otherwise>
						      
						      <li class="addedStoreImage"><img style="width:235px;height:185px;" src="static/images/module/image_upload/imageAddBlank.png" /></li>
						      </c:otherwise>
						    </c:choose>
						</ul>
					</form>
					</td>
				</tr>
			</table>
			<!-- PERSONAL 表格 -->
			<div id="personal_table">
			<form id="personalApplyForm" method="post">
			<table>
				<input type="hidden" name="sellerFileId" id="addPortrailtImageFileHidden" value="${designer.sellerFileId }"></input> 
				<input type="hidden" name="passport" id="addPassportImageFileHidden" value="${designer.passport }"></input> 
				<input type="hidden" name="id" value="${designer.id }" />
				<input type="hidden" name="addressId" value="${address.addressId }" />
				<input type="hidden" id="editType" name="editType" value="${editType }" />
			
				<tr class="storeNameLine">
					<td class="formLabel left">STORE NAME:</td>
					<td><input type="text" id="storeNameInput" name="storeName"
						class="storeNameInput submitInput submitInputWider" required="store name required"
						value="${designer.storeName }" /></td>
				</tr>
			
				<tr class="sellerNameLine">
					<td class="formLabel left">SELLER NAME:</td>
					<td><input type="text" id="sellerNameInput" name="sellerName"
						class="sellerNameInput submitInput submitInputWider" required="seller name required"
						value="${designer.sellerName }" /></td>
				</tr>
				<tr class="locationLine">
					<td class="formLabel left">LOCATION:</td>
					<td class="originDropdown dropdown-group">
						<input type="hidden" class="dropdownHidden" name="strLocationIds" value="${address.strLocationIds }" />
						<input type="text" name="strLocationNames" class="locationDropdown dropdownInput dropdownWider" value="${address.strLocationNames }" readonly />
						<img class="formDropdownArrow" src="static/images/global/formArrow.png" />
						<ul class="dropdownOptions">
							<c:forEach var="item" items="${firstLevelLocationList }">
								<li>
									<div value="${item.id }"
										<c:if test="${empty item.childLocationList }"> class="leaf"</c:if>>${item.name }</div>
									<ul class="dropdownChildOptions">
										<c:forEach var="second" items="${item.childLocationList }">
											<li>
												<div value="${second.id }"
													<c:if test="${empty second.childLocationList }"> class="leaf"</c:if>>${second.name }</div>
												<ul class="dropdownChildOptions">
													<c:forEach var="third" items="${second.childLocationList }">
														<li>
															<div value="${third.id }"
																<c:if test="${empty third.childLocationList }"> class="leaf"</c:if>>${third.name }</div>
															<ul class="dropdownChildOptions dropdownWider">
																<c:forEach var="fourth"
																	items="${third.childLocationList }">
																	<li>
																		<div value="${fourth.id }"
																			<c:if test="${empty fourth.childLocationList }"> class="leaf"</c:if>>${fourth.name }</div>
																	</li>
																</c:forEach>
															</ul>
														</li>
													</c:forEach>
												</ul>
											</li>
										</c:forEach>
									</ul>
								</li>
							</c:forEach>
						</ul></td>
				</tr>
				<tr class="storeDescriptionLine">
					<td class="formLabel left">STH. TO SAY:</td>
					<td><textarea name="favorite" class="storeDescriptionInput">${designer.favorite } </textarea>
						<div class="descriptionReminder">
							SAVE EVERY 5 MINUTES. <!-- <span><input type="button"
								name="storeDescriptionSaveBtn"
								class="storeDescriptionSaveBtn right" value="SAVED" /></span> -->
						</div></td>
				</tr>
			</table>
			<table>			
				<tr class="sellerNameLine">
					<td class="formLabel left"
						style="color: #47caf4; font-weight: bold; padding: 20px 0 0;">PERSONAL&nbsp;&nbsp;&nbsp;IDENTIFICATION:</td>
					<td></td>
				</tr>
				<tr class="contactLine">
					<td class="formLabel left">CONTACT:</td>
					<td><input type="text" name="email" required="email required"
						class="contactInput submitInput submitInputWider"
						placeholder="EMAIL" value="${designer.email }" /> <input
						type="text" name="tel"
						class="contactInput submitInput submitInputWider"
						placeholder="TEL" value="${designer.tel }" required="tel required" /></td>
				</tr>

				<tr class="addressLine hrTableBorder">
					<td class="formLabel left">ADDRESS:</td>
					<td><input type="text" name="street"
						value="${address.street }"
						class="contactInput submitInput submitInputWidest" required="address required" /></td>
				</tr>
			</table>
			</form>
			   <table>
				<tr class="storePortraitLine" style="height: 320px;">
				<td class="formLabel left">PASSPORT:</td>
				<td class="row">
				<form id="addPassportImageFileForm" class="" action="" method="post" enctype="multipart/form-data">
					<c:if test="${editType eq 'designerApply' }">
					<div class="addStoreImageArea col-xs-3">
					<input id="addPassportImageFile" name="addPassportImage"
							class="addStoreImage" type="file" accept="img/*" required="passport required"/>
							 <img class="addImageIcon" src="static/images/page/submitCommodity/photoAddIcon.png" />
					</div>
					</c:if>
					<ul id="passportImageAdded" class="storeImageAdded col-xs-9">
						<c:choose>
						      <c:when test="${not empty designer.passport }">
						      	<li class="addedStoreImage"><img width='270px' height='270px' src="download/${designer.passport  }" />
								<div class="storeImgDeleteIcon" onclick="deleteImage('passportImageAdded')"></div></li>
						      </c:when>
						      <c:otherwise>
						      <li class="addedStoreImage"><img style="width:235px;height:185px;" src="static/images/module/image_upload/imageAddBlank.png" /></li>
						      </c:otherwise>
						</c:choose>
					</ul>
				</form>
				</td>
			    </tr>
			</table>
			</div>
			<!-- PERSONAL 表格结束  -->
			
			<!-- COMPANY 表格 -->
			<div id="company_table" style="display:none;">
			<form id="independentBrandApplyForm" name="independentBrandApplyForm" method="post">
				<input type="hidden" name="sellerFileId" id="addPortrailtImageFileHidden" value="${designer.sellerFileId }"></input> 
				<input type="hidden" name="brandCertificate" id="addBrandCertificateImageFileHidden" value="${designer.brandCertificate }"></input> 
				<input type="hidden" name="businessLicence" id="addBusinessLicenceImageFileHidden" value="${designer.businessLicence }"></input> 
				<input type="hidden" name="legalPassport" id="addLegalPassportImageFileHidden" value="${designer.businessLicence }"></input> 
				<input type="hidden" name="id" value="${designer.id }" />
				<input type="hidden" name="addressId" value="${address.addressId }" />
				<input type="hidden" id="editType" name="editType" value="${editType }" />
			<table>
				<tr class="storeNameLine">
					<td class="formLabel left">STORE NAME:</td>
					<td class="formlabelright"><input type="text" id="storeNameInput" name="storeName" required="store name required"
						class="storeNameInput submitInput submitInputWider"
						value="${designer.storeName }" /></td>
				</tr>
				<tr class="sellerNameLine">
					<td class="formLabel left">SELLER NAME:</td>
					<td><input type="text" id="sellerNameInput" name="sellerName" required="seller name required"
						class="sellerNameInput submitInput submitInputWider"
						value="${designer.sellerName }" /></td>
				</tr>
				<tr class="locationLine">
					<td class="formLabel left">LOCATION:</td>
					<td class="originDropdown dropdown-group">
						<input type="hidden" class="dropdownHidden" name="strLocationIds" value="${address.strLocationIds }" />
						<input type="text" name="strLocationNames" class="locationDropdown dropdownInput dropdownWider" value="${address.strLocationNames }"  readonly />
						<img class="formDropdownArrow" src="static/images/global/formArrow.png" />
						<ul class="dropdownOptions">
							<c:forEach var="item" items="${firstLevelLocationList }">
								<li>
									<div value="${item.id }"
										<c:if test="${empty item.childLocationList }"> class="leaf"</c:if>>${item.name }</div>
									<ul class="dropdownChildOptions">
										<c:forEach var="second" items="${item.childLocationList }">
											<li>
												<div value="${second.id }"
													<c:if test="${empty second.childLocationList }"> class="leaf"</c:if>>${second.name }</div>
												<ul class="dropdownChildOptions">
													<c:forEach var="third" items="${second.childLocationList }">
														<li>
															<div value="${third.id }"
																<c:if test="${empty third.childLocationList }"> class="leaf"</c:if>>${third.name }</div>
															<ul class="dropdownChildOptions dropdownWider">
																<c:forEach var="fourth"
																	items="${third.childLocationList }">
																	<li>
																		<div value="${fourth.id }"
																			<c:if test="${empty fourth.childLocationList }"> class="leaf"</c:if>>${fourth.name }</div>
																	</li>
																</c:forEach>
															</ul>
														</li>
													</c:forEach>
												</ul>
											</li>
										</c:forEach>
									</ul>
								</li>
							</c:forEach>
						</ul></td>
				</tr>
				<tr class="storeDescriptionLine">
					<td class="formLabel left">STH. TO SAY:</td>
					<td><textarea name="favorite" class="storeDescriptionInput">${designer.favorite } </textarea>
						<div class="descriptionReminder">
							SAVE EVERY 5 MINUTES. <!-- <span><input type="button"
								name="storeDescriptionSaveBtn"
								class="storeDescriptionSaveBtn right" value="SAVED" /></span> -->
						</div></td>
				</tr>
			</table>
			<table>
				<tr class="sellerNameLine">
					<td class="formLabel left"
						style="color: #47caf4; font-weight: bold; padding: 20px 0 0;">BRAND&nbsp;&nbsp;&nbsp;QUALIFICATION:</td>
					<td></td>
				</tr>
				<tr class="storeNameLine">
					<td class="formLabel left">COMPANY NAME:</td>
					<td><input type="text" name="companyName" placeholder="COMPANY NAME" required="company name required"
						class="storeNameInput submitInput submitInputWider"
						value="${designer.companyName }" /></td>
				</tr>

				<tr class="contactLine">
					<td class="formLabel left">CONTACTOR:</td>
					<td><input type="text" name="contactor"
						class="contactInput submitInput submitInputWider" required="contactor required"
						placeholder="CONTACTOR" value="${designer.contactor }" value="${designer.contactor }" /> 
				</tr>

				<tr class="contactLine">
					<td class="formLabel left">CONTACT:</td>
					<td><input type="text" name="email"
						class="contactInput submitInput submitInputWider"
						placeholder="EMAIL" value="${designer.email }" required="email required" /> <input
						type="text" name="tel"
						class="contactInput submitInput submitInputWider"
						placeholder="TEL" value="${designer.tel }" required="tel required" /></td>
				</tr>

				<tr class="addressLine hrTableBorder">
					<td class="formLabel left">ADDRESS:</td>
					<td><input type="text" name="street"
						value="${address.street }"
						class="contactInput submitInput submitInputWidest" /></td>
				</tr>
			</table>
			</form>
			<table>
			<tr class="storePortraitLine" style="height: 320px;">
					<td class="formLabel left">BRAND CERTIFICATES:</td>
					<td class="row">
					  <form id="addBrandCertificateImageFileForm" class="" action="" method="post" enctype="multipart/form-data">
					  <c:if test="${editType eq 'designerApply' }">
						<div class="addStoreImageArea col-xs-3">
							<input id="addBrandCertificateImageFile" name="addBrandCertificateImage"
								class="addStoreImage" type="file" accept="img/*" required="brand certificates required" /> <img
								class="addImageIcon"
								src="static/images/page/submitCommodity/photoAddIcon.png" />
						</div>
						</c:if>
						<ul id="brandCertificateImageAdded" class="storeImageAdded col-xs-9">
							<c:if test="${not empty designer.brandCertificate }">
								<li class="addedStoreImage"><img width='270px'
									height='270px' src="download/${designer.brandCertificate  }" />
									<div class="storeImgDeleteIcon" onclick="deleteImage('brandCertificateImageAdded')"></div></li>
							</c:if>
						</ul>
						</form>
					</td>
				</tr>
				<tr class="storePortraitLine" style="height: 320px;">
					<td class="formLabel left">BUSINESS LICENCE:</td>
					<td class="row">
					<form id="addBusinessLicenceImageFileForm" class="" action="" method="post" enctype="multipart/form-data">
					   <c:if test="${editType eq 'designerApply' }">
						<div class="addStoreImageArea col-xs-3">
							<input id="addBusinessLicenceImageFile" name="addBusinessLicenceImage"
								class="addStoreImage" type="file" accept="img/*" required="business licence required" /> <img
								class="addImageIcon"
								src="static/images/page/submitCommodity/photoAddIcon.png" />
						</div>
						</c:if>
						<ul id="businessLicenceImageAdded" class="storeImageAdded col-xs-9">
							<c:if test="${not empty designer.businessLicence }">
								<li class="addedStoreImage"><img width='270px'
									height='270px' src="download/${designer.businessLicence  }" />
									<div class="storeImgDeleteIcon" onclick="deleteImage('businessLicenceImageAdded')"></div></li>
							</c:if>
						</ul>
						</form>
					</td>
				</tr>
				<tr class="storePortraitLine" style="height: 320px;">
					<td class="formLabel left">PASSPORT OF LEGAL REPRESENTATIVE:</td>
					<td class="row">
					<form id="addLegalPassportImageFileForm" class="" action="" method="post" enctype="multipart/form-data">
					   <c:if test="${editType eq 'designerApply' }">
						<div class="addStoreImageArea col-xs-3">
							<input id="addLegalPassportImageFile" name="addLegalPassportImageImage"
								class="addStoreImage" type="file" accept="img/*" required="passort required" /> <img
								class="addImageIcon"
								src="static/images/page/submitCommodity/photoAddIcon.png" />
						</div>
						</c:if>
						<ul id="legalPassportImageAdded" class="storeImageAdded col-xs-9">
							<c:if test="${not empty designer.legalPassport }">
								<li class="addedStoreImage"><img width='270px'
									height='270px' src="download/${designer.legalPassport  }" />
									<div class="storeImgDeleteIcon" onclick="deleteImage('legalPassportImageAdded')"></div></li>
							</c:if>
						</ul>
						</form>
					</td>
				</tr>
			</table>
			</div>
			<!-- COMPANY 表格结束  -->

			<hr class="hrBorder" style="margin: 25px 0 55px;">
			<div class="form-group row">
				<div class="col-xs-2">
					<button type="button" id="btnExit" class="btn btn-default"
						style="border-radius: 0;width: 100px; height: 40px; color: #fff; background: #b5b6b3; margin: 0 0 80px 250px;">CANCEL</button>
				</div>
				<div class="col-xs-8">
					<div id="msg"></div>
				</div>
				<div class="col-xs-2">
					<button type="button" id="btnSave"
						class="btn btn-default pull-right"
						style="border-radius: 0;width: 100px; height: 40px; color: #fff; background: #47caf4; margin: 0 250px 80px 0;">POST</button>
				</div>
			</div>
		
	</div>

	<!-- 页尾结束 -->

	<%@include file="/views/global/AdminScripts.jsp"%>
	<%@include file="/views/global/footer.jsp"%>
</body>
<script type="text/javascript">
	$(document).ready(function() {
		
		
	});
</script>
<script type="text/javascript" src="static/javascript/module/generic.js"></script>
<script type="text/javascript" src="static/javascript/page/submitCommodity/submitStore.js"></script>
</html>